//
//  ZFPlayerTestViewController.m
//  TestPrj
//
//  Created by 朱铅峰 on 2019/12/24.
//  Copyright © 2019 Xing. All rights reserved.
//

#import "ZFPlayerTestViewController.h"
#import "ZFNormalViewController.h"
#import "ZFInTableViewController.h"

@interface ZFPlayerTestViewController ()

proStrong NSArray *dataSource;

@property (nonatomic, copy) void(^listScrollViewScrollCallback)(UIScrollView *scrollView);

@end

@implementation ZFPlayerTestViewController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    self.title = @"ZFPlayer测试";
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemStop target:self action:@selector(dismissAction)];
    
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"];
    
    self.dataSource = @[@"正常样式",@"列表播放"];
}

//退出
- (void)dismissAction {
    
    [self.navigationController dismissViewControllerAnimated:YES completion:nil];
}

#pragma mark - tableView delegate

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return _dataSource.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
    cell.textLabel.text = _dataSource[indexPath.row];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return 44;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    
    switch (indexPath.row) {
        case 0:
        {
            ZFNormalViewController *vc = [[ZFNormalViewController alloc] init];
            [self.navigationController pushViewController:vc animated:YES];
            break;
        }
        case 1:
        {
            
            ZFInTableViewController *vc = [ZFInTableViewController new];
            [self.navigationController pushViewController:vc animated:YES];
            break;
        }
            
        default:
            break;
    }
}

@end
